#include "ma_uart_rxhandle.h"
#include "ma_uart_tx.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "elog.h"
#include <stdlib.h>

TaskHandle_t UART_TxTask_Handle = NULL;

extern QueueHandle_t pRxBuffQueue_Handle;

void UART_TxTask(void)
{
    UART_RxBuff_Type *pbuff = NULL;
    while (1)
    {
        xQueueReceive(pRxBuffQueue_Handle, &pbuff, portMAX_DELAY);
        // log_i("Receive %d bytes!\n", pbuff->rx_len);
        for (uint32_t i = 0; i < pbuff->rx_len; i++)
        {
            log_i("%x", pbuff->rx_data[i]);
        }
        free(pbuff); // 动态分配的临时buffer，用完需要free
    }
}
